import axios from '@/libs/request/axios'
import QS from 'qs';
// 获取理赔数据 多条件
export const getInsuranceInfoList = (params, request = 'contractManage/insurance') => {
    return axios.request({
        url: `/${request}/getInsuranceInfoList`,
        data: params,
        method: 'post'
    })
};
// 保存保险业务数据
export const save = (params,request = 'contractManage/insurance') => {
    return axios.request({
        url: `/${request}/saveInsurance`,
        data: params,
        method: 'post'
    })
};
// 提交保险业务数据
export const submit = (params,request = 'contractManage/insurance') => {
    return axios.request({
        url: `/${request}/submitInsurance`,
        data: params,
        method: 'post'
    })
};
// 保存保险业务审批信息
export const saveProposalApplicationInfo = (params,request = 'contractManage/insurance') => {
    return axios.request({
        url: `/${request}/saveProposalApplicationInfo`,
        data: params,
        method: 'post'
    })
};
// 获取保险信息数据
export const getInsuranceData = (caseNo,request = 'contractManage/insurance') => {
    return axios.request({
        url: `/${request}/getInsuranceData`,
        data: QS.stringify({caseNo: caseNo}, {arrayFormat: 'repeat'}),
        method: 'post',
        headers: {'content-type': 'application/x-www-form-urlencoded'},
    })
};
// 获取处理意见数据
export const getApprovalOpinion = (contractNo, caseNo,request = 'contractManage/insurance') => {
    return axios.request({
        url: `/${request}/getApprovalOpinion`,
        data: QS.stringify({contractNo: contractNo, caseNo: caseNo}, {arrayFormat: 'repeat'}),
        method: 'post',
        headers: {'content-type': 'application/x-www-form-urlencoded'},
    })
};
// 删除案件
export const delById = (id, params,request = 'contractManage/insurance') => {
    return axios.request({
        url: `/${request}/delById/${id}`,
        params: params,
        method: 'delete'
    })
};
// 打印无章授权文件模板
export const PrintTemplate = (params,request = 'contractManage/insurance') => {
    return axios.request({
        url: `/${request}/PrintTemplate`,
        data: params,
        method: 'post',
        responseType: "blob"
    })
};
// 打印有章授权文件模板
export const PrintHaveTemplate = (params,request = 'contractManage/insurance') => {
    return axios.request({
        url: `/${request}/PrintHaveTemplate`,
        data: params,
        method: 'post',
        responseType: "blob"
    })
};
// 根据合同号码查询金融协议车款信息
export const financialAgreeByCar = (contractNo) => {
    return axios.request({
        url: `/contractBasic/financeInfo/financialAgreeByCar`,
        method: 'POST',
        params: { contractNo }
    })
};
